console.log('-----------------------\n')

module.define("hd", [], function() {
  return {
    first(arr) {
      return arr[0];
    },
    max(arr, key) {
      return arr.sort((a, b) => b[key] - a[key])[0];
    }
  };
});
module.define("lesson", ["hd"], function(hd) {
  let data = [
    { name: "js", price: 199 },
    { name: "mysql", price: 278 }
  ];

  console.log(hd.first(data))
  console.log(hd.max(data, 'price'))
  
});


module.define("a", [], function() {
  return {
    site: "后盾人",
    url: "houdunren.com"
  };
});

module.define("b", ["a"], function(a) {
  a.site = "hdcms";
  a.name = '给a模块添加了名字'
});

module.define("c", ["a"], function(a) {
  console.log(a);
});



